import javax.media.opengl.GL;
import javax.media.opengl.GL2;

/**
 * Created by IntelliJ IDEA.
 * User: blakekl10
 * Date: 2/6/11
 * Time: 11:15 PM
 *
 * used to draw a simple grid pattern at the plane y = yValue to mimick ground.
 * To change this template use File | Settings | File Templates.
 */
public class Ground {
    private float xStep;
    private float zStep;
    private float xStart;
    private float zStart;
    private final float MAX = 100;
    private final float yValue = 0.0f;

    public Ground(){
        xStep = 1.0f;
        zStep = 1.0f;
        xStart = -100.0f;
        zStart = -100.0f;
    }

    public void render(GL2 gl){
        gl.glPushMatrix();
        gl.glBegin(GL.GL_TRIANGLE_STRIP);
        gl.glNormal3f(0.0f, 1.0f, 0.0f);
        gl.glColor3f(0.5f, 0.5f, 0.5f);
        gl.glVertex3f(-100.0f, yValue, -100.0f);
        gl.glVertex3f(-100.0f, yValue, 100.0f);
        gl.glVertex3f(100.0f, yValue, -100.0f);
        gl.glVertex3f(100.0f, yValue, 100.0f);
        gl.glEnd();
        gl.glPopMatrix();
    }
}
